<?php 
	$this->display(tpl('head',true));
?>
	<style>
		.layui-form-checkbox {
		    position: relative;
		    height: 20px;
		    line-height: 20px;
		    margin-right: 10px;
		    padding-right: 20px;
		}
		.layui-form-checkbox i {
		    width: 22px;
		    font-size: 15px;
		}
		.none{
			text-align: center;
			width: 100%;
			float: left;
			font-size: 2em;
			font-weight: bold;
			padding: 20px 0;
			color: red;
		}
	</style>
	<fieldset class="layui-elem-field layui-field-title">
	  	<legend>升级检测</legend>
	</fieldset>
	
	<form class="layui-form" method="post" action="/admin/upgrade/post/">
		<?php if ($mvc){ ?>
		<table class="layui-table  my-tabel">
			<thead>
				<th>主程序升级</th>
			</thead>
			<tbody>
				<tr>
					<td>
						<?php foreach($data['mvc'] AS $ROW){ ?>
						<table class="layui-table  my-tabel">
							<thead>
								<th width="50"><input type="checkbox" name="iddb[mvc][<?php echo $ROW[id] ?>]" value="<?php echo $ROW[version] ?>" /></th>
								<th> <?php echo  $ROW[title] ?></th>
								<th width="100">
									版本号：<?php echo  $ROW[version] ?>
								</th>
								<th width="135">
									更新时间：<?php echo date('Ymd',$ROW[uptime]) ?>
								</th>
							</thead>
							<tbody>
								<tr>
									<td colspan="4">
										<?php  echo htmlspecialchars_decode( $ROW[content]) ?>
									</td>
								</tr>
							</tbody>
						</table>
						<?php } ?>
						<?php if(!$data['mvc']){ ?>
								<span class='none'>暂无更新</span>
						<?php } ?>	
					</td>
				</tr>
			</tbody>
		</table>
		<?php } ?>
			
		<?php if ($data['modular']){ ?>
		<table class="layui-table  my-tabel">
			<thead>
				<th>模块升级</th>
			</thead>
			<tbody>
				<tr>
					<td>
						<?php foreach($data['modular'] AS $KEY=>$ROW){ ?>
						<table class="layui-table  my-tabel">
							<thead>
								<th width="50"><?php echo $ROW['name']; unset($ROW['name']);?></th>	
							</thead>
							<tbody>
								<tr>
									<td>
										<?php foreach($ROW AS $ROWS){ ?>
											<table class="layui-table  my-tabel">
												<thead>
													<th width="50"><input type="checkbox" name="iddb[modular][<?php echo $KEY ?>][<?php echo $ROWS[id] ?>]" value="<?php echo $ROWS[version] ?>" /></th>
													<th> <?php echo  $ROWS[title] ?></th>
													<th width="100">
														版本号：<?php echo  $ROWS[version] ?>
													</th>
													<th width="135">
														更新时间：<?php echo date('Ymd',$ROWS[uptime]) ?>
													</th>
												</thead>
												<tbody>
													<tr>
														<td colspan="4">
															<?php  echo htmlspecialchars_decode( $ROWS[content]) ?>
														</td>
													</tr>
												</tbody>
											</table>
										<?php } ?>
										<?php if(!$ROW){ ?>
											<span class='none'>暂无更新</span>
										<?php } ?>
									</td>
								</tr>
							</tbody>
						</table>
						<?php } ?>
					</td>
				</tr>
			</tbody>
		</table>
		<?php } ?>
		<?php if ($data['plugin']){ ?>
		<table class="layui-table  my-tabel">
			<thead>
				<th>插件升级</th>
			</thead>
			<tbody>
				<tr>
					<td>
						<?php foreach($data['plugin'] AS $KEY=>$ROW){ ?>
						<table class="layui-table  my-tabel">
							<thead>
								<th width="50"><?php echo $ROW['name']; unset($ROW['name']);?></th>	
							</thead>
							<tbody>
								<tr>
									<td>
										<?php foreach($ROW AS $ROWS){ ?>
											<table class="layui-table  my-tabel">
												<thead>
													<th width="50"><input type="checkbox" name="iddb[plugin][<?php echo $KEY ?>][<?php echo $ROWS[id] ?>]" value="<?php echo $ROWS[version] ?>" /></th>
													<th> <?php echo  $ROWS[title] ?></th>
													<th width="100">
														版本号：<?php echo  $ROWS[version] ?>
													</th>
													<th width="135">
														更新时间：<?php echo date('Ymd',$ROWS[uptime]) ?>
													</th>
												</thead>
												<tbody>
													<tr>
														<td colspan="4">
															<?php  echo htmlspecialchars_decode( $ROWS[content]) ?>
														</td>
													</tr>
												</tbody>
											</table>
										<?php } ?>
										<?php if(!$ROW){ ?>
											<span class='none'>暂无更新</span>
										<?php } ?>
									</td>
								</tr>
							</tbody>
						</table>
						<?php } ?>
					</td>
				</tr>
			</tbody>
		</table>
		<?php } ?>	
		<table class="layui-table  my-tabel">	
			<tbody>
				<tr>
					<td>
						<input type="hidden" name="upgrade_temporary_number" value="<?php echo $data[upgrade_temporary_number] ?>" />
						<input type="hidden" name="step" id="step" value="post" />
						<button class="layui-btn">立即更新</button>
					</td>
				</tr>
			</tbody>
		</table>
	</from>
<script>
	$('#load').remove();
	layui.config({
			version: '<?php echo NOWTIME ?>'
	});
	layui.use(['form'], function(){
	  	var $ = layui.jquery
		var form = layui.form;
	});
</script>
<?php $this->display(tpl('foot',true)); ?>
